{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A crash course in\n",
    "<b><font size=44px><center> Surviving Titanic</center></font></b>\n",
    "<img src='http://4.media.bustedtees.cvcdn.com/f/-/bustedtees.d6ab8f8f-a63a-45fd-acac-142e2c22.gif' width=400>\n",
    "<center> (with numpy and matplotlib)</center>\n",
    "\n",
    "---\n",
    "\n",
    "This notebook's gonna teach you to use the basic data science stack for python: jupyter, numpy, matplotlib and sklearn."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Part I: Jupyter notebooks in a nutshell\n",
    "* You are reading this line in a jupyter notebook.\n",
    "* A notebook consists of cells. A cell can contain either code or hypertext. \n",
    "    * This cell contains hypertext. The next cell contains code.\n",
    "* You can __run a cell__ with code by selecting it (click) and pressing `Ctrl + Enter` to execute the code and display output(if any).\n",
    "* If you're running this on a device with no keyboard, ~~you are doing it wrong~~ use topbar (esp. play/stop/restart buttons) to run code.\n",
    "* Behind the curtains, there's a python interpreter that runs that code and remembers anything you defined.\n",
    "\n",
    "Run these cells to get started"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print(a * 2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* `Ctrl + S` to save changes (or use the button that looks like a floppy disk)\n",
    "* Top menu -> Kernel -> Interrupt (or Stop button) if you want it to stop running cell midway.\n",
    "* Top menu -> Kernel -> Restart (or cyclic arrow button) if interrupt doesn't fix the problem (you will lose all variables).\n",
    "* For shortcut junkies like us: Top menu -> Help -> Keyboard Shortcuts\n",
    "\n",
    "\n",
    "* More: [Hacker's guide](http://arogozhnikov.github.io/2016/09/10/jupyter-features.html), [Beginner's guide'](https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/), [Datacamp tutorial](https://www.datacamp.com/community/tutorials/tutorial-jupyter-notebook)\n",
    "\n",
    "Now __the most important feature__ of jupyter notebooks for this course: \n",
    "* if you're typing something, press `Tab` to see automatic suggestions, use arrow keys + enter to pick one.\n",
    "* if you move your cursor inside some function and press `__Shift + Tab__`, you'll get a help window. `Shift + (Tab , Tab)` will expand it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# run this first",
    "\n",
    "import math"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# place your cursor at the end of the unfinished line below to find a function",
    "\n",
    "# that computes arctangent from two parameters (should have 2 in it's name)",
    "\n",
    "# once you chose it, press shift + tab + tab(again) to see the docs",
    "\n",
    "\n",
    "math.a  # <---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Part II: Loading data with Pandas\n",
    "Pandas is a library that helps you load the data, prepare it and perform some lightweight analysis. The god object here is the `pandas.DataFrame` - a 2d table with batteries included. \n",
    "\n",
    "In the cell below we use it to read the data on the infamous titanic shipwreck.\n",
    "\n",
    "__please keep running all the code cells as you read__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd",
    "\n",
    "# this yields a pandas.DataFrame",
    "\n",
    "data = pd.read_csv(\"train.csv\", index_col='PassengerId')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>PassengerId</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>PC 17599</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C85</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>113803</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>C123</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>373450</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Moran, Mr. James</td>\n",
       "      <td>male</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>330877</td>\n",
       "      <td>8.4583</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>McCarthy, Mr. Timothy J</td>\n",
       "      <td>male</td>\n",
       "      <td>54.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>17463</td>\n",
       "      <td>51.8625</td>\n",
       "      <td>E46</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Palsson, Master. Gosta Leonard</td>\n",
       "      <td>male</td>\n",
       "      <td>2.0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>349909</td>\n",
       "      <td>21.0750</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)</td>\n",
       "      <td>female</td>\n",
       "      <td>27.0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>347742</td>\n",
       "      <td>11.1333</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Nasser, Mrs. Nicholas (Adele Achem)</td>\n",
       "      <td>female</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>237736</td>\n",
       "      <td>30.0708</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Survived  Pclass  \\\n",
       "PassengerId                     \n",
       "1                   0       3   \n",
       "2                   1       1   \n",
       "3                   1       3   \n",
       "4                   1       1   \n",
       "5                   0       3   \n",
       "6                   0       3   \n",
       "7                   0       1   \n",
       "8                   0       3   \n",
       "9                   1       3   \n",
       "10                  1       2   \n",
       "\n",
       "                                                          Name     Sex   Age  \\\n",
       "PassengerId                                                                    \n",
       "1                                      Braund, Mr. Owen Harris    male  22.0   \n",
       "2            Cumings, Mrs. John Bradley (Florence Briggs Th...  female  38.0   \n",
       "3                                       Heikkinen, Miss. Laina  female  26.0   \n",
       "4                 Futrelle, Mrs. Jacques Heath (Lily May Peel)  female  35.0   \n",
       "5                                     Allen, Mr. William Henry    male  35.0   \n",
       "6                                             Moran, Mr. James    male   NaN   \n",
       "7                                      McCarthy, Mr. Timothy J    male  54.0   \n",
       "8                               Palsson, Master. Gosta Leonard    male   2.0   \n",
       "9            Johnson, Mrs. Oscar W (Elisabeth Vilhelmina Berg)  female  27.0   \n",
       "10                         Nasser, Mrs. Nicholas (Adele Achem)  female  14.0   \n",
       "\n",
       "             SibSp  Parch            Ticket     Fare Cabin Embarked  \n",
       "PassengerId                                                          \n",
       "1                1      0         A/5 21171   7.2500   NaN        S  \n",
       "2                1      0          PC 17599  71.2833   C85        C  \n",
       "3                0      0  STON/O2. 3101282   7.9250   NaN        S  \n",
       "4                1      0            113803  53.1000  C123        S  \n",
       "5                0      0            373450   8.0500   NaN        S  \n",
       "6                0      0            330877   8.4583   NaN        Q  \n",
       "7                0      0             17463  51.8625   E46        S  \n",
       "8                3      1            349909  21.0750   NaN        S  \n",
       "9                0      2            347742  11.1333   NaN        S  \n",
       "10               1      0            237736  30.0708   NaN        C  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Selecting rows",
    "\n",
    "head = data[:10]",
    "\n",
    "\n",
    "head  # if you leave an expression at the end of a cell, jupyter will \"display\" it automatically"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### About the data\n",
    "Here's some of the columns\n",
    "* Name - a string with person's full name\n",
    "* Survived - 1 if a person survived the shipwreck, 0 otherwise.\n",
    "* Pclass - passenger class. Pclass == 3 is cheap'n'cheerful, Pclass == 1 is for moneybags.\n",
    "* Sex - a person's gender (in those good ol' times when there were just 2 of them)\n",
    "* Age - age in years, if available\n",
    "* Sibsp - number of siblings on a ship\n",
    "* Parch - number of parents on a ship\n",
    "* Fare - ticket cost\n",
    "* Embarked - port where the passenger embarked\n",
    " * C = Cherbourg; Q = Queenstown; S = Southampton"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "len(data) =  891\n",
      "data.shape =  (891, 11)\n"
     ]
    }
   ],
   "source": [
    "# table dimensions",
    "\n",
    "print(\"len(data) = \", len(data))",
    "\n",
    "print(\"data.shape = \", data.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Survived                                               1\n",
      "Pclass                                                 1\n",
      "Name        Futrelle, Mrs. Jacques Heath (Lily May Peel)\n",
      "Sex                                               female\n",
      "Age                                                   35\n",
      "SibSp                                                  1\n",
      "Parch                                                  0\n",
      "Ticket                                            113803\n",
      "Fare                                                53.1\n",
      "Cabin                                               C123\n",
      "Embarked                                               S\n",
      "Name: 4, dtype: object\n"
     ]
    }
   ],
   "source": [
    "# select a single row",
    "\n",
    "print(data.loc[4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PassengerId\n",
      "1     22.0\n",
      "2     38.0\n",
      "3     26.0\n",
      "4     35.0\n",
      "5     35.0\n",
      "6      NaN\n",
      "7     54.0\n",
      "8      2.0\n",
      "9     27.0\n",
      "10    14.0\n",
      "Name: Age, dtype: float64\n"
     ]
    }
   ],
   "source": [
    "# select a single column.",
    "\n",
    "ages = data[\"Age\"]",
    "\n",
    "print(ages[:10])  # alternatively: data.Age"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fare</th>\n",
       "      <th>Pclass</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>PassengerId</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>8.0500</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>8.4583</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>51.8625</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>21.0750</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>11.1333</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>30.0708</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                Fare  Pclass\n",
       "PassengerId                 \n",
       "5             8.0500       3\n",
       "6             8.4583       3\n",
       "7            51.8625       1\n",
       "8            21.0750       3\n",
       "9            11.1333       3\n",
       "10           30.0708       2"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# select several columns and rows at once",
    "\n",
    "# alternatively: data[[\"Fare\",\"Pclass\"]].loc[5:10]",
    "\n",
    "data.loc[5:10, (\"Fare\", \"Pclass\")]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Your turn:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# select passengers number 13 and 666 - did they survive?",
    "\n",
    "\n",
    "<YOUR CODE >"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# compute the overall survival rate (what fraction of passengers survived the shipwreck)",
    "\n",
    "\n",
    "<YOUR CODE >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Pandas also has some basic data analysis tools. For one, you can quickly display statistical aggregates for each column using `.describe()`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Some columns contain __NaN__ values - this means that there is no data there. For example, passenger `#5` has unknown age. To simplify the future data analysis, we'll replace NaN values by using pandas `fillna` function.\n",
    "\n",
    "_Note: we do this so easily because it's a tutorial. In general, you think twice before you modify data like this._"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.iloc[5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['Age'] = data['Age'].fillna(value=data['Age'].mean())",
    "\n",
    "data['Fare'] = data['Fare'].fillna(value=data['Fare'].mean())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.iloc[5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "More pandas: \n",
    "* A neat [tutorial](http://pandas.pydata.org/) from pydata\n",
    "* Official [tutorials](https://pandas.pydata.org/pandas-docs/stable/tutorials.html), including this [10 minutes to pandas](https://pandas.pydata.org/pandas-docs/stable/10min.html#min)\n",
    "* Bunch of cheat sheets awaits just one google query away from you (e.g. [basics](http://blog.yhat.com/static/img/datacamp-cheat.png), [combining datasets](https://pbs.twimg.com/media/C65MaMpVwAA3v0A.jpg) and so on). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Part III: Numpy and vectorized computing\n",
    "\n",
    "Almost any machine learning model requires some computational heavy lifting usually involving linear algebra problems. Unfortunately, raw python is terrible at this because each operation is interpreted at runtime. \n",
    "\n",
    "So instead, we'll use `numpy` - a library that lets you run blazing fast computation with vectors, matrices and other tensors. Again, the god object here is `numpy.ndarray`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a =  [1 2 3 4 5]\n",
      "b =  [5 4 3 2 1]\n",
      "a + 1 = [2 3 4 5 6]\n",
      "a * 2 = [ 2  4  6  8 10]\n",
      "a == 2 [False  True False False False]\n",
      "a + b = [6 6 6 6 6]\n",
      "a * b = [5 8 9 8 5]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np",
    "\n",
    "\n",
    "a = np.array([1, 2, 3, 4, 5])",
    "\n",
    "b = np.array([5, 4, 3, 2, 1])",
    "\n",
    "print(\"a = \", a)",
    "\n",
    "print(\"b = \", b)",
    "\n",
    "\n",
    "# math and boolean operations can applied to each element of an array",
    "\n",
    "print(\"a + 1 =\", a + 1)",
    "\n",
    "print(\"a * 2 =\", a * 2)",
    "\n",
    "print(\"a == 2\", a == 2)",
    "\n",
    "# ... or corresponding elements of two (or more) arrays",
    "\n",
    "print(\"a + b =\", a + b)",
    "\n",
    "print(\"a * b =\", a * b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Your turn: compute half-products of a and b elements (halves of products)",
    "\n",
    "<YOUR CODE >"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# compute elementwise quotient between squared a and (b plus 1)",
    "\n",
    "<YOUR CODE >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "\n",
    "### How fast is it, harry?\n",
    "![img](https://img.buzzfeed.com/buzzfeed-static/static/2015-11/6/7/enhanced/webdr10/enhanced-buzz-22847-1446811476-0.jpg)\n",
    "\n",
    "Let's compare computation time for python and numpy\n",
    "* Two arrays of 10^6 elements\n",
    " * first - from 0 to 1 000 000\n",
    " * second - from 99 to 1 000 099\n",
    " \n",
    "* Computing:\n",
    " * elemwise sum\n",
    " * elemwise product\n",
    " * square root of first array\n",
    " * sum of all elements in the first array\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%%time",
    "\n",
    "# ^-- this \"magic\" measures and prints cell computation time",
    "\n",
    "\n",
    "# Option I: pure python",
    "\n",
    "arr_1 = range(1000000)",
    "\n",
    "arr_2 = range(99, 1000099)",
    "\n",
    "\n",
    "\n",
    "a_sum = []",
    "\n",
    "a_prod = []",
    "\n",
    "sqrt_a1 = []",
    "\n",
    "for i in range(len(arr_1)):",
    "\n",
    "    a_sum.append(arr_1[i]+arr_2[i])",
    "\n",
    "    a_prod.append(arr_1[i]*arr_2[i])",
    "\n",
    "    a_sum.append(arr_1[i]**0.5)",
    "\n",
    "\n",
    "arr_1_sum = sum(arr_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%% time",
    "\n",
    "\n",
    "# Option II: start from python, convert to numpy",
    "\n",
    "arr_1 = range(1000000)",
    "\n",
    "arr_2 = range(99, 1000099)",
    "\n",
    "\n",
    "arr_1, arr_2 = np.array(arr_1), np.array(arr_2)",
    "\n",
    "\n",
    "\n",
    "a_sum = arr_1 + arr_2",
    "\n",
    "a_prod = arr_1 * arr_2",
    "\n",
    "sqrt_a1 = arr_1 ** .5",
    "\n",
    "arr_1_sum = arr_1.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "%% time",
    "\n",
    "\n",
    "# Option III: pure numpy",
    "\n",
    "arr_1 = np.arange(1000000)",
    "\n",
    "arr_2 = np.arange(99, 1000099)",
    "\n",
    "\n",
    "a_sum = arr_1 + arr_2",
    "\n",
    "a_prod = arr_1 * arr_2",
    "\n",
    "sqrt_a1 = arr_1 ** .5",
    "\n",
    "arr_1_sum = arr_1.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If you want more serious benchmarks, take a look at [this](http://brilliantlywrong.blogspot.ru/2015/01/benchmarks-of-speed-numpy-vs-all.html)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "\n",
    "There's also a bunch of pre-implemented operations including logarithms, trigonometry, vector/matrix products and aggregations."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "numpy.sum(a) =  15\n",
      "numpy.mean(a) =  3.0\n",
      "numpy.min(a) =  1\n",
      "numpy.argmin(b) =  4\n",
      "numpy.dot(a,b) =  35\n",
      "numpy.unique(['male','male','female','female','male']) =  ['female' 'male']\n"
     ]
    }
   ],
   "source": [
    "a = np.array([1, 2, 3, 4, 5])",
    "\n",
    "b = np.array([5, 4, 3, 2, 1])",
    "\n",
    "print(\"numpy.sum(a) = \", np.sum(a))",
    "\n",
    "print(\"numpy.mean(a) = \", np.mean(a))",
    "\n",
    "print(\"numpy.min(a) = \",  np.min(a))",
    "\n",
    "print(\"numpy.argmin(b) = \", np.argmin(b))  # index of minimal element",
    "\n",
    "# dot product. Also used for matrix/tensor multiplication",
    "\n",
    "print(\"numpy.dot(a,b) = \", np.dot(a, b))",
    "\n",
    "print(\"numpy.unique(['male','male','female','female','male']) = \", np.unique(",
    "\n",
    "    ['male', 'male', 'female', 'female', 'male']))",
    "\n",
    "\n",
    "# and tons of other stuff. see http://bit.ly/2u5q430 ."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The important part: all this functionality works with dataframes:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max ticket price:  512.3292\n",
      "\n",
      "The guy who paid the most:\n",
      " Survived                   1\n",
      "Pclass                     1\n",
      "Name        Ward, Miss. Anna\n",
      "Sex                   female\n",
      "Age                       35\n",
      "SibSp                      0\n",
      "Parch                      0\n",
      "Ticket              PC 17755\n",
      "Fare                 512.329\n",
      "Cabin                    NaN\n",
      "Embarked                   C\n",
      "Name: 259, dtype: object\n"
     ]
    }
   ],
   "source": [
    "print(\"Max ticket price: \", np.max(data[\"Fare\"]))",
    "\n",
    "print(\"\\nThe guy who paid the most:\\n\", data.loc[np.argmax(data[\"Fare\"])])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# your code: compute mean passenger age and the oldest guy on the ship",
    "\n",
    "<YOUR CODE >"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Boolean operations\n",
      "a =  [1 2 3 4 5]\n",
      "b =  [5 4 3 2 1]\n",
      "a > 2 [False False  True  True  True]\n",
      "numpy.logical_not(a>2) =  [ True  True False False False]\n",
      "numpy.logical_and(a>2,b>2) =  [False False  True False False]\n",
      "numpy.logical_or(a>4,b<3) =  [False False  True  True  True]\n",
      "\n",
      " shortcuts\n",
      "~(a > 2) =  [ True  True False False False]\n",
      "(a > 2) & (b > 2) =  [False False  True False False]\n",
      "(a > 2) | (b < 3) =  [False False  True  True  True]\n"
     ]
    }
   ],
   "source": [
    "print(\"Boolean operations\")",
    "\n",
    "\n",
    "print('a = ', a)",
    "\n",
    "print('b = ', b)",
    "\n",
    "print(\"a > 2\", a > 2)",
    "\n",
    "print(\"numpy.logical_not(a>2) = \", np.logical_not(a > 2))",
    "\n",
    "print(\"numpy.logical_and(a>2,b>2) = \", np.logical_and(a > 2, b > 2))",
    "\n",
    "print(\"numpy.logical_or(a>4,b<3) = \", np.logical_or(a > 2, b < 3))",
    "\n",
    "\n",
    "print(\"\\n shortcuts\")",
    "\n",
    "print(\"~(a > 2) = \", ~(a > 2))  # logical_not(a > 2)",
    "\n",
    "print(\"(a > 2) & (b > 2) = \", (a > 2) & (b > 2))  # logical_and",
    "\n",
    "print(\"(a > 2) | (b < 3) = \", (a > 2) | (b < 3))  # logical_or"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The final numpy feature we'll need is indexing: selecting elements from an array. \n",
    "Aside from python indexes and slices (e.g. a[1:4]), numpy also allows you to select several elements at once."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a =  [ 0  1  4  9 16 25]\n",
      "Select by element index\n",
      "a[[1,2,5]] =  [1 4 25]\n",
      "\n",
      "Select by boolean mask\n",
      "a[a > 5] =  [ 9 16 25]\n",
      "(a % 2 == 0) = [ True False  True False  True False]\n",
      "a[a > 3] = [ 0  4 16]\n",
      "data[(data['Age'] < 18) & (data['Sex'] == 'male')] = (below)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>PassengerId</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Palsson, Master. Gosta Leonard</td>\n",
       "      <td>male</td>\n",
       "      <td>2.00</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>349909</td>\n",
       "      <td>21.0750</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Rice, Master. Eugene</td>\n",
       "      <td>male</td>\n",
       "      <td>2.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>382652</td>\n",
       "      <td>29.1250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Panula, Master. Juha Niilo</td>\n",
       "      <td>male</td>\n",
       "      <td>7.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3101295</td>\n",
       "      <td>39.6875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Goodwin, Master. William Frederick</td>\n",
       "      <td>male</td>\n",
       "      <td>11.00</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>CA 2144</td>\n",
       "      <td>46.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Skoog, Master. Harald</td>\n",
       "      <td>male</td>\n",
       "      <td>4.00</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>347088</td>\n",
       "      <td>27.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Caldwell, Master. Alden Gates</td>\n",
       "      <td>male</td>\n",
       "      <td>0.83</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>248738</td>\n",
       "      <td>29.0000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Ford, Mr. William Neal</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>W./C. 6608</td>\n",
       "      <td>34.3750</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>126</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Nicola-Yarred, Master. Elias</td>\n",
       "      <td>male</td>\n",
       "      <td>12.00</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2651</td>\n",
       "      <td>11.2417</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Osen, Mr. Olaf Elon</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7534</td>\n",
       "      <td>9.2167</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Calic, Mr. Jovo</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>315093</td>\n",
       "      <td>8.6625</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Panula, Master. Eino Viljami</td>\n",
       "      <td>male</td>\n",
       "      <td>1.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3101295</td>\n",
       "      <td>39.6875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>166</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Goldsmith, Master. Frank John William \"Frankie\"</td>\n",
       "      <td>male</td>\n",
       "      <td>9.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>363291</td>\n",
       "      <td>20.5250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Rice, Master. Arthur</td>\n",
       "      <td>male</td>\n",
       "      <td>4.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>382652</td>\n",
       "      <td>29.1250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Asplund, Master. Clarence Gustaf Hugo</td>\n",
       "      <td>male</td>\n",
       "      <td>9.00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>347077</td>\n",
       "      <td>31.3875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Becker, Master. Richard F</td>\n",
       "      <td>male</td>\n",
       "      <td>1.00</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>230136</td>\n",
       "      <td>39.0000</td>\n",
       "      <td>F4</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Navratil, Master. Michel M</td>\n",
       "      <td>male</td>\n",
       "      <td>3.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>230080</td>\n",
       "      <td>26.0000</td>\n",
       "      <td>F2</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>221</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Sunderland, Mr. Victor Francis</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>SOTON/OQ 392089</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>262</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Asplund, Master. Edvin Rojj Felix</td>\n",
       "      <td>male</td>\n",
       "      <td>3.00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>347077</td>\n",
       "      <td>31.3875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>267</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Panula, Mr. Ernesti Arvid</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3101295</td>\n",
       "      <td>39.6875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>279</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Rice, Master. Eric</td>\n",
       "      <td>male</td>\n",
       "      <td>7.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>382652</td>\n",
       "      <td>29.1250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>283</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>de Pelsmaeker, Mr. Alfons</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>345778</td>\n",
       "      <td>9.5000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>306</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Allison, Master. Hudson Trevor</td>\n",
       "      <td>male</td>\n",
       "      <td>0.92</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>113781</td>\n",
       "      <td>151.5500</td>\n",
       "      <td>C22 C26</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>334</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Vander Planke, Mr. Leo Edmondus</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>345764</td>\n",
       "      <td>18.0000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>341</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Navratil, Master. Edmond Roger</td>\n",
       "      <td>male</td>\n",
       "      <td>2.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>230080</td>\n",
       "      <td>26.0000</td>\n",
       "      <td>F2</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>349</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Coutts, Master. William Loch \"William\"</td>\n",
       "      <td>male</td>\n",
       "      <td>3.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>C.A. 37671</td>\n",
       "      <td>15.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>353</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Elias, Mr. Tannous</td>\n",
       "      <td>male</td>\n",
       "      <td>15.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2695</td>\n",
       "      <td>7.2292</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>387</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Goodwin, Master. Sidney Leonard</td>\n",
       "      <td>male</td>\n",
       "      <td>1.00</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>CA 2144</td>\n",
       "      <td>46.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>408</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Richards, Master. William Rowe</td>\n",
       "      <td>male</td>\n",
       "      <td>3.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29106</td>\n",
       "      <td>18.7500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>434</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Kallio, Mr. Nikolai Erland</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>STON/O 2. 3101274</td>\n",
       "      <td>7.1250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>446</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Dodge, Master. Washington</td>\n",
       "      <td>male</td>\n",
       "      <td>4.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>33638</td>\n",
       "      <td>81.8583</td>\n",
       "      <td>A34</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>481</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Goodwin, Master. Harold Victor</td>\n",
       "      <td>male</td>\n",
       "      <td>9.00</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>CA 2144</td>\n",
       "      <td>46.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>490</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Coutts, Master. Eden Leslie \"Neville\"</td>\n",
       "      <td>male</td>\n",
       "      <td>9.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>C.A. 37671</td>\n",
       "      <td>15.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>501</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Calic, Mr. Petar</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>315086</td>\n",
       "      <td>8.6625</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>533</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Elias, Mr. Joseph Jr</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2690</td>\n",
       "      <td>7.2292</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>550</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Davies, Master. John Morgan Jr</td>\n",
       "      <td>male</td>\n",
       "      <td>8.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>C.A. 33112</td>\n",
       "      <td>36.7500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>551</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Thayer, Mr. John Borland Jr</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>17421</td>\n",
       "      <td>110.8833</td>\n",
       "      <td>C70</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>575</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Rush, Mr. Alfred George John</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>A/4. 20589</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Goodwin, Mr. Charles Edward</td>\n",
       "      <td>male</td>\n",
       "      <td>14.00</td>\n",
       "      <td>5</td>\n",
       "      <td>2</td>\n",
       "      <td>CA 2144</td>\n",
       "      <td>46.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Panula, Mr. Jaako Arnold</td>\n",
       "      <td>male</td>\n",
       "      <td>14.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3101295</td>\n",
       "      <td>39.6875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Jensen, Mr. Svend Lauritz</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>350048</td>\n",
       "      <td>7.0542</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>732</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Hassan, Mr. Houssein G N</td>\n",
       "      <td>male</td>\n",
       "      <td>11.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2699</td>\n",
       "      <td>18.7875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>747</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Abbott, Mr. Rossmore Edward</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>C.A. 2673</td>\n",
       "      <td>20.2500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>752</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Moor, Master. Meier</td>\n",
       "      <td>male</td>\n",
       "      <td>6.00</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>392096</td>\n",
       "      <td>12.4750</td>\n",
       "      <td>E121</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>756</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Hamalainen, Master. Viljo</td>\n",
       "      <td>male</td>\n",
       "      <td>0.67</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>250649</td>\n",
       "      <td>14.5000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>765</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Eklund, Mr. Hans Linus</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>347074</td>\n",
       "      <td>7.7750</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>788</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Rice, Master. George Hugh</td>\n",
       "      <td>male</td>\n",
       "      <td>8.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>382652</td>\n",
       "      <td>29.1250</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Q</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>789</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Dean, Master. Bertram Vere</td>\n",
       "      <td>male</td>\n",
       "      <td>1.00</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>C.A. 2315</td>\n",
       "      <td>20.5750</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>792</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>Gaskell, Mr. Alfred</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>239865</td>\n",
       "      <td>26.0000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>803</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Carter, Master. William Thornton II</td>\n",
       "      <td>male</td>\n",
       "      <td>11.00</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>113760</td>\n",
       "      <td>120.0000</td>\n",
       "      <td>B96 B98</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>804</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Thomas, Master. Assad Alexander</td>\n",
       "      <td>male</td>\n",
       "      <td>0.42</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2625</td>\n",
       "      <td>8.5167</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>820</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Skoog, Master. Karl Thorsten</td>\n",
       "      <td>male</td>\n",
       "      <td>10.00</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>347088</td>\n",
       "      <td>27.9000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>825</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Panula, Master. Urho Abraham</td>\n",
       "      <td>male</td>\n",
       "      <td>2.00</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>3101295</td>\n",
       "      <td>39.6875</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>828</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Mallet, Master. Andre</td>\n",
       "      <td>male</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>S.C./PARIS 2079</td>\n",
       "      <td>37.0042</td>\n",
       "      <td>NaN</td>\n",
       "      <td>C</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>832</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>Richards, Master. George Sibley</td>\n",
       "      <td>male</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>29106</td>\n",
       "      <td>18.7500</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>842</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>Mudd, Mr. Thomas Charles</td>\n",
       "      <td>male</td>\n",
       "      <td>16.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>S.O./P.P. 3</td>\n",
       "      <td>10.5000</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>845</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Culumovic, Mr. Jeso</td>\n",
       "      <td>male</td>\n",
       "      <td>17.00</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>315090</td>\n",
       "      <td>8.6625</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>851</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Andersson, Master. Sigvard Harald Elias</td>\n",
       "      <td>male</td>\n",
       "      <td>4.00</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>347082</td>\n",
       "      <td>31.2750</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>870</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Johnson, Master. Harold Theodor</td>\n",
       "      <td>male</td>\n",
       "      <td>4.00</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>347742</td>\n",
       "      <td>11.1333</td>\n",
       "      <td>NaN</td>\n",
       "      <td>S</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             Survived  Pclass  \\\n",
       "PassengerId                     \n",
       "8                   0       3   \n",
       "17                  0       3   \n",
       "51                  0       3   \n",
       "60                  0       3   \n",
       "64                  0       3   \n",
       "79                  1       2   \n",
       "87                  0       3   \n",
       "126                 1       3   \n",
       "139                 0       3   \n",
       "164                 0       3   \n",
       "165                 0       3   \n",
       "166                 1       3   \n",
       "172                 0       3   \n",
       "183                 0       3   \n",
       "184                 1       2   \n",
       "194                 1       2   \n",
       "221                 1       3   \n",
       "262                 1       3   \n",
       "267                 0       3   \n",
       "279                 0       3   \n",
       "283                 0       3   \n",
       "306                 1       1   \n",
       "334                 0       3   \n",
       "341                 1       2   \n",
       "349                 1       3   \n",
       "353                 0       3   \n",
       "387                 0       3   \n",
       "408                 1       2   \n",
       "434                 0       3   \n",
       "446                 1       1   \n",
       "481                 0       3   \n",
       "490                 1       3   \n",
       "501                 0       3   \n",
       "533                 0       3   \n",
       "550                 1       2   \n",
       "551                 1       1   \n",
       "575                 0       3   \n",
       "684                 0       3   \n",
       "687                 0       3   \n",
       "722                 0       3   \n",
       "732                 0       3   \n",
       "747                 0       3   \n",
       "752                 1       3   \n",
       "756                 1       2   \n",
       "765                 0       3   \n",
       "788                 0       3   \n",
       "789                 1       3   \n",
       "792                 0       2   \n",
       "803                 1       1   \n",
       "804                 1       3   \n",
       "820                 0       3   \n",
       "825                 0       3   \n",
       "828                 1       2   \n",
       "832                 1       2   \n",
       "842                 0       2   \n",
       "845                 0       3   \n",
       "851                 0       3   \n",
       "870                 1       3   \n",
       "\n",
       "                                                        Name   Sex    Age  \\\n",
       "PassengerId                                                                 \n",
       "8                             Palsson, Master. Gosta Leonard  male   2.00   \n",
       "17                                      Rice, Master. Eugene  male   2.00   \n",
       "51                                Panula, Master. Juha Niilo  male   7.00   \n",
       "60                        Goodwin, Master. William Frederick  male  11.00   \n",
       "64                                     Skoog, Master. Harald  male   4.00   \n",
       "79                             Caldwell, Master. Alden Gates  male   0.83   \n",
       "87                                    Ford, Mr. William Neal  male  16.00   \n",
       "126                             Nicola-Yarred, Master. Elias  male  12.00   \n",
       "139                                      Osen, Mr. Olaf Elon  male  16.00   \n",
       "164                                          Calic, Mr. Jovo  male  17.00   \n",
       "165                             Panula, Master. Eino Viljami  male   1.00   \n",
       "166          Goldsmith, Master. Frank John William \"Frankie\"  male   9.00   \n",
       "172                                     Rice, Master. Arthur  male   4.00   \n",
       "183                    Asplund, Master. Clarence Gustaf Hugo  male   9.00   \n",
       "184                                Becker, Master. Richard F  male   1.00   \n",
       "194                               Navratil, Master. Michel M  male   3.00   \n",
       "221                           Sunderland, Mr. Victor Francis  male  16.00   \n",
       "262                        Asplund, Master. Edvin Rojj Felix  male   3.00   \n",
       "267                                Panula, Mr. Ernesti Arvid  male  16.00   \n",
       "279                                       Rice, Master. Eric  male   7.00   \n",
       "283                                de Pelsmaeker, Mr. Alfons  male  16.00   \n",
       "306                           Allison, Master. Hudson Trevor  male   0.92   \n",
       "334                          Vander Planke, Mr. Leo Edmondus  male  16.00   \n",
       "341                           Navratil, Master. Edmond Roger  male   2.00   \n",
       "349                   Coutts, Master. William Loch \"William\"  male   3.00   \n",
       "353                                       Elias, Mr. Tannous  male  15.00   \n",
       "387                          Goodwin, Master. Sidney Leonard  male   1.00   \n",
       "408                           Richards, Master. William Rowe  male   3.00   \n",
       "434                               Kallio, Mr. Nikolai Erland  male  17.00   \n",
       "446                                Dodge, Master. Washington  male   4.00   \n",
       "481                           Goodwin, Master. Harold Victor  male   9.00   \n",
       "490                    Coutts, Master. Eden Leslie \"Neville\"  male   9.00   \n",
       "501                                         Calic, Mr. Petar  male  17.00   \n",
       "533                                     Elias, Mr. Joseph Jr  male  17.00   \n",
       "550                           Davies, Master. John Morgan Jr  male   8.00   \n",
       "551                              Thayer, Mr. John Borland Jr  male  17.00   \n",
       "575                             Rush, Mr. Alfred George John  male  16.00   \n",
       "684                              Goodwin, Mr. Charles Edward  male  14.00   \n",
       "687                                 Panula, Mr. Jaako Arnold  male  14.00   \n",
       "722                                Jensen, Mr. Svend Lauritz  male  17.00   \n",
       "732                                 Hassan, Mr. Houssein G N  male  11.00   \n",
       "747                              Abbott, Mr. Rossmore Edward  male  16.00   \n",
       "752                                      Moor, Master. Meier  male   6.00   \n",
       "756                                Hamalainen, Master. Viljo  male   0.67   \n",
       "765                                   Eklund, Mr. Hans Linus  male  16.00   \n",
       "788                                Rice, Master. George Hugh  male   8.00   \n",
       "789                               Dean, Master. Bertram Vere  male   1.00   \n",
       "792                                      Gaskell, Mr. Alfred  male  16.00   \n",
       "803                      Carter, Master. William Thornton II  male  11.00   \n",
       "804                          Thomas, Master. Assad Alexander  male   0.42   \n",
       "820                             Skoog, Master. Karl Thorsten  male  10.00   \n",
       "825                             Panula, Master. Urho Abraham  male   2.00   \n",
       "828                                    Mallet, Master. Andre  male   1.00   \n",
       "832                          Richards, Master. George Sibley  male   0.83   \n",
       "842                                 Mudd, Mr. Thomas Charles  male  16.00   \n",
       "845                                      Culumovic, Mr. Jeso  male  17.00   \n",
       "851                  Andersson, Master. Sigvard Harald Elias  male   4.00   \n",
       "870                          Johnson, Master. Harold Theodor  male   4.00   \n",
       "\n",
       "             SibSp  Parch             Ticket      Fare    Cabin Embarked  \n",
       "PassengerId                                                               \n",
       "8                3      1             349909   21.0750      NaN        S  \n",
       "17               4      1             382652   29.1250      NaN        Q  \n",
       "51               4      1            3101295   39.6875      NaN        S  \n",
       "60               5      2            CA 2144   46.9000      NaN        S  \n",
       "64               3      2             347088   27.9000      NaN        S  \n",
       "79               0      2             248738   29.0000      NaN        S  \n",
       "87               1      3         W./C. 6608   34.3750      NaN        S  \n",
       "126              1      0               2651   11.2417      NaN        C  \n",
       "139              0      0               7534    9.2167      NaN        S  \n",
       "164              0      0             315093    8.6625      NaN        S  \n",
       "165              4      1            3101295   39.6875      NaN        S  \n",
       "166              0      2             363291   20.5250      NaN        S  \n",
       "172              4      1             382652   29.1250      NaN        Q  \n",
       "183              4      2             347077   31.3875      NaN        S  \n",
       "184              2      1             230136   39.0000       F4        S  \n",
       "194              1      1             230080   26.0000       F2        S  \n",
       "221              0      0    SOTON/OQ 392089    8.0500      NaN        S  \n",
       "262              4      2             347077   31.3875      NaN        S  \n",
       "267              4      1            3101295   39.6875      NaN        S  \n",
       "279              4      1             382652   29.1250      NaN        Q  \n",
       "283              0      0             345778    9.5000      NaN        S  \n",
       "306              1      2             113781  151.5500  C22 C26        S  \n",
       "334              2      0             345764   18.0000      NaN        S  \n",
       "341              1      1             230080   26.0000       F2        S  \n",
       "349              1      1         C.A. 37671   15.9000      NaN        S  \n",
       "353              1      1               2695    7.2292      NaN        C  \n",
       "387              5      2            CA 2144   46.9000      NaN        S  \n",
       "408              1      1              29106   18.7500      NaN        S  \n",
       "434              0      0  STON/O 2. 3101274    7.1250      NaN        S  \n",
       "446              0      2              33638   81.8583      A34        S  \n",
       "481              5      2            CA 2144   46.9000      NaN        S  \n",
       "490              1      1         C.A. 37671   15.9000      NaN        S  \n",
       "501              0      0             315086    8.6625      NaN        S  \n",
       "533              1      1               2690    7.2292      NaN        C  \n",
       "550              1      1         C.A. 33112   36.7500      NaN        S  \n",
       "551              0      2              17421  110.8833      C70        C  \n",
       "575              0      0         A/4. 20589    8.0500      NaN        S  \n",
       "684              5      2            CA 2144   46.9000      NaN        S  \n",
       "687              4      1            3101295   39.6875      NaN        S  \n",
       "722              1      0             350048    7.0542      NaN        S  \n",
       "732              0      0               2699   18.7875      NaN        C  \n",
       "747              1      1          C.A. 2673   20.2500      NaN        S  \n",
       "752              0      1             392096   12.4750     E121        S  \n",
       "756              1      1             250649   14.5000      NaN        S  \n",
       "765              0      0             347074    7.7750      NaN        S  \n",
       "788              4      1             382652   29.1250      NaN        Q  \n",
       "789              1      2          C.A. 2315   20.5750      NaN        S  \n",
       "792              0      0             239865   26.0000      NaN        S  \n",
       "803              1      2             113760  120.0000  B96 B98        S  \n",
       "804              0      1               2625    8.5167      NaN        C  \n",
       "820              3      2             347088   27.9000      NaN        S  \n",
       "825              4      1            3101295   39.6875      NaN        S  \n",
       "828              0      2    S.C./PARIS 2079   37.0042      NaN        C  \n",
       "832              1      1              29106   18.7500      NaN        S  \n",
       "842              0      0        S.O./P.P. 3   10.5000      NaN        S  \n",
       "845              0      0             315090    8.6625      NaN        S  \n",
       "851              4      2             347082   31.2750      NaN        S  \n",
       "870              1      1             347742   11.1333      NaN        S  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.array([0, 1, 4, 9, 16, 25])",
    "\n",
    "ix = np.array([1, 2, 5])",
    "\n",
    "print(\"a = \", a)",
    "\n",
    "print(\"Select by element index\")",
    "\n",
    "print(\"a[[1,2,5]] = \", a[ix])",
    "\n",
    "\n",
    "print(\"\\nSelect by boolean mask\")",
    "\n",
    "# select all elementts in a that are greater than 5",
    "\n",
    "print(\"a[a > 5] = \", a[a > 5])",
    "\n",
    "print(\"(a % 2 == 0) =\", a % 2 == 0)  # True for even, False for odd",
    "\n",
    "print(\"a[a > 3] =\", a[a % 2 == 0])  # select all elements in a that are even",
    "\n",
    "\n",
    "\n",
    "# select male children",
    "\n",
    "print(\"data[(data['Age'] < 18) & (data['Sex'] == 'male')] = (below)\")",
    "\n",
    "data[(data['Age'] < 18) & (data['Sex'] == 'male')]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Your turn\n",
    "\n",
    "Use numpy and pandas to answer a few questions about data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# who on average paid more for their ticket, men or women?",
    "\n",
    "\n",
    "mean_fare_men = <YOUR CODE >",
    "\n",
    "mean_fare_women = <YOUR CODE >",
    "\n",
    "\n",
    "print(mean_fare_men, mean_fare_women)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# who is more likely to survive: a child (<18 yo) or an adult?",
    "\n",
    "\n",
    "child_survival_rate = <YOUR CODE >",
    "\n",
    "adult_survival_rate = <YOUR CODE >",
    "\n",
    "\n",
    "print(child_survival_rate, adult_survival_rate)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Part IV: plots and matplotlib\n",
    "\n",
    "Using python to visualize the data is covered by yet another library: `matplotlib`.\n",
    "\n",
    "Just like python itself, matplotlib has an awesome tendency of keeping simple things simple while still allowing you to write complicated stuff with convenience (e.g. super-detailed plots or custom animations)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f2fec9370f0>]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iV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gB855/7pcWlBZ2Y/AdKAzs65S7yuJ9jMbDeQ5pwLet99OFyhf3UzaudcFfDl\nzagjlnNuJVDodR0txTmX55xb7X9cAmyh7p61EcvVOeL/so3/I7SvrgLAzJKB/wCe87qWSBQOgX6s\nm1FH9C97NDOzvsAo4FNvKwk+/9LDWmA/sNw5F/GvGfgDMB3weV1IC3LAX80sy3+P5aAJh0Bv1M2o\nJfyZWUdgMfBj59xhr+sJNudcrXNuJHX34x1rZhG9vGZmlwD7nXNZXtfSws50zo0GLgbu8i+pBkU4\nBHqjbkYt4c2/jrwYeMk5t8TrelqSc64Y+BCY4HEpwXYmcJl/TXk+8G0ze9HbkoLPObfP/3k/sJS6\nZeSgCIdA182oI5z/DcJZwBbn3O+9rqclmFmimXX1P44FvgNs9baq4HLO/dw5l+yc60vd7/H7zrnJ\nHpcVVGbWwf9GP2bWAbgQCFr3WsgHunOuBvjyZtRbgIWRfjNqM3sF+AQYbGY5ZjbV65qC7EzgBuqu\n2Nb6PyZ6XVSQ9QI+MLP11F20LHfORUUbX5RJAj4ys3XAKuBN59w7wTpZyLctiohI44T8FbqIiDSO\nAl1EJEIo0EVEIoQCXUQkQijQRUQihAJdRCRCKNBFRCKEAl1EJEL8H8Ew9ivee4KpAAAAAElFTkSu\nQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f2fee543518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt",
    "\n",
    "%matplotlib inline",
    "\n",
    "# ^-- this \"magic\" tells all future matplotlib plots to be drawn inside notebook and not in a separate window.",
    "\n",
    "\n",
    "# line plot",
    "\n",
    "plt.plot([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAA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SRiOi9L33vfAKvSsfRr2XRMSrkt6teo5uiogrEXG+uP++\npEWV8Bm1e0Vs+qB42F987e1XVx1g+25Jfy7pW1XPklEvBL0rH0aNvcP2kKQRSa9XO0m5iksPFyRd\nlXQ2IlI/38I/SvpbSR9WPUgXhaQf2T5n+2SZJ+qFoDf1YdTIwfbtkp6X9EREvFf1PGWKiI2IOKrN\nz+M9Zjv15TXbX5B0NSLOVT1Llx2PiE9J+rykR4tLqqXohaA39WHU6H3FteTnJT0bEdNVz9MtEbEm\n6T8knah4lLIdl/QXxTXl70j6U9v/Wu1I5YuIleL2qqQXtHkZuRS9EPSufBg1qlW8Sfi0pMWIeKrq\necpme8D2weJ+TdKfSfqvaqcqV0RMRsTdETGkzf+PX46Iv654rFLZvq14k1+2b5P0OUml7V7b80GP\niGuStj6MelHSd8v4MOq9xPZzkn4sadj2ZduPVD1TFxyX9JA2X7VdKL7ur3qoEh2W9IrtN7T5ouVs\nROyLbXz7zF2SXrP9c0k/lfT9iPhhWSfb89sWAQDN2fOv0AEAzSHoAJAEQQeAJAg6ACRB0AEgCYIO\nAEkQdABIgqADQBL/D9zw1GD2JwfWAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f2fec9032e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# scatter-plot",
    "\n",
    "plt.scatter([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25])",
    "\n",
    "\n",
    "plt.show()  # show the first plot and begin drawing next one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x7f2fe8fcaf28>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEWCAYAAABrDZDcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAAC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+eTnQ\nTdIg4Hvg1XSOORj4StLnQE/gurCY6VuC4qG0sf8maQhBkcdKgt46026zO6xgHaigW+edBHcarwCv\nhUVKe4DuZvZHOnXNqcdZJ+keYCbBr+N3zOztjL4cM9uooIJ7Yvi9biAYX7s/MCz8XDuAbhkdI/R3\ngsrbFILv+fpw+YPAUAWP3OZ0BLNSCh4EKEaQ2CAYD2BIWFm9L7Ga2S5JPYD/hIn0M+C1HJ7X5THv\nfdQlnIJhJqdY8NiqyweUhwOnu8TzoiHnnCvi/I7AOeeKOL8jcM65Is4TgXPOFXGeCJxzrojzROCc\nc0WcJwLnnCvi/h+9ZIddrte+FgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f2fe9023048>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# draw a scatter plot with custom markers and colors",
    "\n",
    "plt.scatter([1, 1, 2, 3, 4, 4.5], [3, 2, 2, 5, 15, 24],",
    "\n",
    "            c=[\"red\", \"blue\", \"orange\", \"green\", \"cyan\", \"gray\"], marker=\"x\")",
    "\n",
    "\n",
    "# without .show(), several plots will be drawn on top of one another",
    "\n",
    "plt.plot([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25], c=\"black\")",
    "\n",
    "\n",
    "# adding more sugar",
    "\n",
    "plt.title(\"Conspiracy theory proven!!!\")",
    "\n",
    "plt.xlabel(\"Per capita alcohol consumption\")",
    "\n",
    "plt.ylabel(\"# Layers in state of the art image classifier\")",
    "\n",
    "\n",
    "# fun with correlations: http://bit.ly/1FcNnWF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAD8CAYAAABXe05zAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACtpJREFUeJzt21+IZnd9x/HPt9kUNVpsySg2yXYsiK0INmUQ20Bpo5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Ps6SqeneS\nU919Yt2z7KMjSX4+yZ9396VJ/jsL/ff5XLG9rntVkjcm+ckkF1TV+9Y71cFyroR7pdvqD5qqOj+n\no31Td9+67nn2wWVJ3lNVj+b0ctjlVfWp9Y60uMeSPNbdz/1v6pacDvlB9q4k/9rdT3b3/ya5Nckv\nrnmm/fKfVfWGJNn+fGqJnZwr4T50t9VXVeX0uufJ7v7YuufZD9390e6+uLs3c/pr/OXuPtBnYt39\nH0m+VVVv3n7pnUm+tsaR9sM3k7yjql61/X3+zhzwH8ie4XNJPrD9+ANJ/mqJnax05+TSDult9Zcl\neX+Sf66qB7Zf+4Ptu1Q5WH43yU3bJyWPJPmtNc+zqO6+p6puSXJfTl89dX8O4F2UVXVzkl9OcmFV\nPZbkD5Ncl+QzVfXBnP4H7DcX2bc7JwFmOVeWSgBYkXADDCPcAMMIN8Awwg0wjHADDCPcAMMIN8Aw\n/wfyAUtpkLVzwQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f2fe8f573c8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(array([ 4.,  7.,  5.,  3.,  3.]),\n",
       " array([  0.,   2.,   4.,   6.,   8.,  10.]),\n",
       " <a list of 5 Patch objects>)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAD8CAYAAABXe05zAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAC+NJREFUeJzt3W2IpXUdxvHrakfxIcNqj2Ku0ySIFYFuHCRbkFILbUN7\nUaCgmAjzpkwjiLU30TuDEH0RwmA+QGbIphRqpviACLU1u261ukpmm65POxLlQ5BpVy/mbEzrmT33\nruc+Z35nvh8Yds6Ze8/53ez69d7/3H/GSQQAqOM94x4AAHBgCDcAFEO4AaAYwg0AxRBuACiGcANA\nMYQbAIoh3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x0K2IcGsVbqtP8mKSbb3PX9Pi\nf8wTvyPV9jpJGyXdMO5ZRsH2+ySdIelHkpTkzSR/H+9UIzEl6XDbU5KOUJ+9H9UleUTS3/Z5+nxJ\nt/Q+v0XSl9p475US7lW9rd72jKT1kraMd5KRuFbStyX9Z9yDjMiJkhYk3dRbHrrB9pHjHqpNSZ6X\n9ANJz0p6UdI/ktw33qlG5tgkL0qLF2eSjmnjTVZKuBttq59Ett8r6WeSrkzy6rjnaZPtL0rak2Tr\nuGcZoSlJn5R0fZL1kt5QS/98Xil667rnS/qIpA9JOtL2ReOdarKslHA32lY/aWwfosVo35rkjnHP\nMwIbJJ1ne5cWl8POtP3j8Y7Uut2SdifZ+6+pzVoM+SQ7W9Jfkiwk+bekOyR9eswzjcrLto+TpN6v\ne9p4k5US7lW3rd62tbjuuTPJNeOeZxSSXJVkXZIZLf4ZP5hkoq/Ekrwk6TnbJ/eeOkvSE2McaRSe\nlfQp20f0/p6fpQn/huwSv5B0Se/zSyT9vI03abRzsm2rdFv9BkkXS/qj7e29577T26WKyXK5pFt7\nFyXPSLp0zPO0KskW25slbdPi3VOPaQJ3Udq+TdJnJK21vVvSdyVdLel225dp8X9gX2nlvdk5CQC1\nrJSlEgBAQ4QbAIoh3ABQDOEGgGIINwAUQ7gBoBjCDQDFEG4AKOa/UjWhMNE1Bt8AAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f2fe8ed0be0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# histogram - showing data density",
    "\n",
    "plt.hist([0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7, 7, 8, 9, 10])",
    "\n",
    "plt.show()",
    "\n",
    "\n",
    "plt.hist([0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4,",
    "\n",
    "          4, 5, 5, 5, 6, 7, 7, 8, 9, 10], bins=5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# plot a histogram of age and a histogram of ticket fares on separate plots",
    "\n",
    "\n",
    "<YOUR CODE >",
    "\n",
    "\n",
    "# bonus: use tab shift-tab to see if there is a way to draw a 2D histogram of age vs fare."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# make a scatter plot of passenger age vs ticket fare",
    "\n",
    "\n",
    "<YOUR CODE >",
    "\n",
    "\n",
    "# kudos if you add separate colors for men and women"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* Extended [tutorial](https://matplotlib.org/2.0.2/users/pyplot_tutorial.html)\n",
    "* A [cheat sheet](http://bit.ly/2koHxNF)\n",
    "* Other libraries for more sophisticated stuff: [Plotly](https://plot.ly/python/) and [Bokeh](https://bokeh.pydata.org/en/latest/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Part V (final): machine learning with scikit-learn\n",
    "\n",
    "<img src='https://imgs.xkcd.com/comics/machine_learning.png' width=320px>\n",
    "\n",
    "Scikit-learn is _the_ tool for simple machine learning pipelines. \n",
    "\n",
    "It's a single library that unites a whole bunch of models under the common interface:\n",
    "* Create:__ `model = sklearn.whatever.ModelNameHere(parameters_if_any)`__\n",
    "* Train:__ `model.fit(X,y)`__\n",
    "* Predict:__ `model.predict(X_test)`__\n",
    "\n",
    "It also contains utilities for feature extraction, quality estimation or cross-validation."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test accuracy: 0.66\n"
     ]
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier",
    "\n",
    "from sklearn.metrics import accuracy_score",
    "\n",
    "\n",
    "features = data[[\"Fare\", \"SibSp\"]].copy()",
    "\n",
    "answers = data[\"Survived\"]",
    "\n",
    "\n",
    "model = RandomForestClassifier(n_estimators=100)",
    "\n",
    "model.fit(features[:-100], answers[:-100])",
    "\n",
    "\n",
    "test_predictions = model.predict(features[-100:])",
    "\n",
    "print(\"Test accuracy:\", accuracy_score(answers[-100:], test_predictions))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Final quest: add more features to achieve accuracy of at least 0.80\n",
    "\n",
    "__Hint:__ for string features like \"Sex\" or \"Embarked\" you will have to compute some kind of numeric representation.\n",
    "For example, 1 if male and 0 if female or vice versa \n",
    "\n",
    "__Hint II:__ you can use `model.feature_importances_` to get a hint on how much did it rely each of your features."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* Sklearn [tutorials](http://scikit-learn.org/stable/tutorial/index.html)\n",
    "* Sklearn [examples](http://scikit-learn.org/stable/auto_examples/index.html)\n",
    "* SKlearn [cheat sheet](http://scikit-learn.org/stable/_static/ml_map.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "```\n",
    "\n",
    "\n",
    "Okay, what we learned: to survive a shipwreck you need to become an underaged girl with parents on the ship. Try this next time you'll find yourself in a shipwreck"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
